<template>
  <!-- 入库单 -->
  <div>
    <el-tabs v-model="activeId" type="border-card" @tab-click="handleClick">
      <el-tab-pane label="全部" name="-1" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="草稿" name="DRAFT" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="已审核" name="TO_BE_CONFIRMED" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="在途" name="ON_THE_WAY" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="仓库收货" name="RECEIPT" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="收货完成" name="RECEIPT_COMPLETED" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="上架完成" name="SHELF_COMPLETION" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="取消" name="CHANCE" :disabled="isdisabled"></el-tab-pane>

      <component :is="view" :tag-index="activeId" @disabled-handler="disabledHandler"></component>
    </el-tabs>
  </div>
</template>

<script>
import WarehousingOrder from './components/warehousing-info.vue'

export default {
  components: { WarehousingOrder },
  name: 'WarehousingOrderEntrance',
  data() {
    return {
      activeId: 'DRAFT',
      view: 'WarehousingOrder',
      isdisabled: false,
    }
  },

  methods: {
    handleClick(e) {
      console.log(e.name, '=')
      this.activeId = e.name
    },

    disabledHandler(data) {
      this.isdisabled = data
    },
  },
}
</script>
